#include <BustaNetServer.h>
Public Member Functions | |
BustaNetServer () | |
Constructor. | |
~BustaNetServer () | |
Destructor. | |
char * | init (Uint16 servport) |
Initialize the server. | |
void | sendAccept (int playerID, bool response, char *message) |
Sends a connection response to a connecting client. | |
void | sendCharacterSelectModeAll () |
Notifies all connected clients that multiplayer character selection is taking place. | |
void | sendDisconnectedAllO (int disc_client, char *message) |
Send a disconnect notification to all connected clients. | |
void | sendPlayerLostAllO (int lost_player) |
Sends a notification to all client when one client has lost in the current game. | |
void | sendServerSetupAll () |
Sends server information to all connected clients. | |
void | sendGameStartAll () |
Notifies all connected clients to start the multiplayer game. | |
void | sendUpdateAll () |
Sends client game state information to all connected clients. | |
void | setDebug (bool OnOff) |
Sets the server in debug mode. | |
void | setMaxClients (int maxC) |
Sets the maximum number of allowed connections. | |
void | setName (char *servname) |
Sets the name of the server. | |
int | setStateAccept () |
Sets the server in client connection accepting mode. | |
int | setStateCharSelect () |
Sets the server in client character selection mode. | |
int | setStateGame () |
Sets the server in game mode. |
Standalone server class for hosting and handling multiplayer games of Busta'Sandwich..
|
Constructor.
|
|
Destructor.
|
|
Initialize the server. Initializes SDL and SDLNet. A socket to connect to the server is created for the server's ip address on the specified port.
|
|
Sends a connection response to a connecting client. Responds to a client's connection attempt. The client is sent a message detailing whether or not the connection was allowed, a message describing why or why not the connection was allowed, and the player's identification number if the connection was accepted.
|
|
Notifies all connected clients that multiplayer character selection is taking place. A message is sent to all clients connected to the server that all clients are to now select a multiplayer character. |
|
Send a disconnect notification to all connected clients. Sends a notification message to all clients that are still connected when a client disconnects from the server. Includes details as to why client disconnected.
|
|
Notifies all connected clients to start the multiplayer game. A message is sent to all connected clients that the multiplayer game is now starting. |
|
Sends a notification to all client when one client has lost in the current game. A notification that a client has lost in the current multiplayer game is sent to all other connected clients. The player who has lost is not notified.
|
|
Sends server information to all connected clients. A message containing the server settings and information is sent to all clients. |
|
Sends client game state information to all connected clients. Sends game state information to all connected clients. This includes the brief information required by each player as well as the detailed game state requested by each client. |
|
Sets the server in debug mode. Turns on debugging output to the console for the server.
|
|
Sets the maximum number of allowed connections. Specifies the maximum number of simultaneous connections allowed by clients at any given time.
|
|
Sets the name of the server. Assigns the server an identification name.
|
|
Sets the server in client connection accepting mode. The server is now in a state to accept incoming TCP connections from clients. The server may leave this mode when all connected clients have sent a ready notification to the server and there is at least two connected clients.
|
|
Sets the server in client character selection mode. The server is now in a state that allows clients to select a multiplayer character. The server leaves this mode when all connected clients have sent a selected character to the server. The server may also leave this mode if client disconnects occur leaving less than two connected clients.
|
|
Sets the server in game mode. The server is now in multiplayer game mode. All clients are currently playing the game. The server leaves this mode when all but one player has lost in the game or less than two clients remain connected to the server while in this mode.
|